package br.unicamp.ic.jorge.mc302.util;

public class Util {
	
	  //maximo divisor comum
	  public static int MDC (int x, int y) {
	    int mdc=0;
	    for(int i=1; i<= Math.min(x, y); i++) {
	      if(( ((x % i) == 0) && ( (y % i) == 0) ) && (i>mdc) ){
		    mdc = i;  	
		  }
		}
		return mdc;
	  }
	  
	  //minimo multiplo comum
	  public static int MMC (int x, int y){ 
	    return ((x * y)/MDC(x,y));
	  }

}
